<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改密码</title>
#include("./jscss.html")
<script src="../inc/lib/sha1.js"></script>
<script src="../inc/lib/jquery.placeholder.min.js"></script>
<script src="../inc/lib/jquery-easyui/jquery.easyui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript">
	$(function(){
		var errMsg = "#(errMsg??0)";
		if(errMsg != 0){
			$.messager.alert("提示",errMsg);
		}
	});
	
	function check(){
		var userName = $('input[name="username"]').val();
		var oldpassword = hex_sha1($('input[name="oldPassword"]').val());
		var newPassword = $('input[name="newPassword"]').val();
		var newPassword2 = $('input[name="newPassword2"]').val();
		if(newPassword!=newPassword2){
			$.messager.alert('提示',
					'两次输入的密码不一致'   
				);
			return false;
		}else{
			var password = hex_sha1($('input[name="newPassword"]').val());
		    $('input[name="newPassword"]').val(password);
			var password2 = hex_sha1($('input[name="newPassword2"]').val());
		    $('input[name="newPassword2"]').val(password2);
		    $('input[name="oldPassword"]').val(oldpassword);
			return true;
		}
	}
</script>
</head>
<body>
		<div id="loginPanel" class="col-lg-offset-4 col-md-offset-4 col-md-4 col-xs-12 panel panel-success" style="margin-height: 308px;">
			<form action="domodifyPassword" onsubmit="return check()">
				<h2 class="form-signin-heading">修改密码</h2>
				<br>
				<label for="employeeID" class="sr-only">employeeID</label> 
				<input type="username" name="username" class="form-control"
					placeholder="工号" required autofocus> 
				<br>
				<label for="inputPassword" class="sr-only">password</label> 
				<input type="password" name="oldPassword" class="form-control"
					placeholder="原密码" required> 
				<br> 
				<label for="inputPassword" class="sr-only">password</label> 
				<input type="password" name="newPassword" class="form-control"
					placeholder="新密码" required> 
				<br> 
				<label for="inputPassword" class="sr-only">password</label> 
				<input type="password" name="newPassword2" class="form-control"
					placeholder="确认密码" required> 
				<br> 
				<button class="btn btn-lg btn-primary btn-block" type="submit">修改密码</button>
			</form>
		</div>
</body>
</html>